﻿<?php //Seyret Component v.0.3//
/**
* @package Seyret
* @version 0.3
* @copyright Copyright (C) 2008 Mustafa DINDAR. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* Seyret Video Component is a free software.
* See seyrettos.html for license notices and details.
*/

// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );


$document = & JFactory::getDocument();

$jslink=JURI :: root()."components/com_seyret/includes/js/jquery-ui-1.7.2.custom.min.js";
$document->addScript($jslink);

echo $this->toolbar;
echo $this->modtoolbar;


?>




<div>

	<div class="searchbar">
		<form action="<?php echo $this->absURL("index.php?option=com_seyret&amp;view=search&amp;task=qs"); ?>" method="get" name="adminForm">
			<input type="text" name="qssearchkey" id="qssearchkey" class="searchkeyinputbox" value="<?php echo $this->searchkey; ?>" />

					<input type="hidden" name="option" value="com_seyret" />
					<input type="hidden" name="view" value="search" />
					<input type="hidden" name="task" value="qs" />

					
			<input type="submit" value="<?php echo JText::_('Search');?>" id="submit" class="searchbutton" />		

		</form>
					
		
	</div>


	

			
<script type="text/javascript">
	jQuery(function() {
		index = jQuery.cookie('videosearchtab');
		if (!index) index = 0;
		
		jQuery("#tabsvideodets").tabs({ cookie: { expires: 30, name: 'videosearchtab', path: '/' },  selected: index });
	});
</script>



<div class="jquerytabs">

	<div id="tabsvideodets">
		<ul>
			<?php if (isset($this->qsresvideos)) {
			?>
			<li><a href="#videosresults"><?php echo JText::_('Videos');?></a></li>
			<?php
			} 
			?>

			<?php if (isset($this->qsresplaylists)) {
			?>
			<li><a href="#playlistsresults"><?php echo JText::_('Playlists');?></a></li>
			<?php
			} 
			?>
			

			<li><a href="#channelsresults"><?php echo JText::_('Channels');?></a></li>
		</ul>
		


		<?php if (isset($this->qsresvideos)) {
		?>
		
		<div id="videosresults"  >
		
		
			<div>
				<div style="float:right;">
					<?php
					
						//create switch button here
						if ($this->qsvdisplay=="oc") {
						?>
						<a href="<?php echo $this->absURL("index.php?option=com_seyret&view=search&task=qs&qsvd=multi&searchkey=".$this->searchkey);?>">
							<img src="<?php echo JURI::root()."components/com_seyret/themes/default/images/switchmulti.png";?>" alt="" />
						</a>
						
						<?php
						
						} else {
						?>
						<a href="<?php echo $this->absURL("index.php?option=com_seyret&view=search&task=qs&qsvd=oc&searchkey=".$this->searchkey);?>">
							<img src="<?php echo JURI::root()."components/com_seyret/themes/default/images/switchoc.png";?>" alt="" />
						</a>
						
						<?php							
						}
					
					?>

				</div>
				<div style="clear:both;"></div>
			</div>


				
			<?php
	
			//generate one column view
			if ($this->qsvdisplay == "oc") {
			
				foreach ($this->qsresvideos as $qsresvideo) {
				
					$safevideotitle = str_replace("'", "\'", $qsresvideo->videotitle);
					$safevideotitle = str_replace("\"", "&quot;", $safevideotitle);				
				
					$inql = false;
					if (in_array($qsresvideo->id, $this->quicklistarray)) {
						$inql = true;			
					}

				?>
				
				<div class="listedvideolistvideooc">
					<div class="listedvideolistinfooc">

						<div class="listedvideolisttitledivoc">
							<a href="<?php echo $qsresvideo->videolink;?>" style="font-weight:bold;">
								<?php echo $qsresvideo->videotitle;?>
							</a>
						</div>
						<div class="listedvideolistdescdivoc">
							<?php echo $qsresvideo->videodescription;?>
						</div>
						<div class="listedvideolistfootdivoc">
							<?php echo JText::_('Added Date');?>: <?php echo $qsresvideo->addeddate;?>   - <?php echo JText::_('Duration');?>: <?php echo $qsresvideo->duration;?>
						</div>
						
					</div>
					
					<div class="listedvideolistthumbdivoc">
						<a href="<?php echo $qsresvideo->videolink;?>">
							<img class="listedvideolistthumbnailoc" src="<?php echo $qsresvideo->videothumbnail;?>" alt=""/> 
						</a>
						<div id="qsvaddtoqlbdiv<?php echo $qsresvideo->id; ?>" class="videolistqlbtnoc">

							<img id="qsvaddtoqlimg_js_<?php echo $qsresvideo->id; ?>" class="addtoquicklistbutton" src="<?php echo JURI::root()."components/com_seyret/themes/default/images/add_ql.png";?>" alt="" onclick="jQuery.seyrettools.addtoquicklist('<?php echo $qsresvideo->id; ?>', '<?php echo htmlentities($qsresvideo->videothumbnail);?>', '<?php echo $safevideotitle; ?>', '<?php echo $qsresvideo->videonojxlink; ?>')" style="visibility:<?php echo ($inql==false)? 'visible' : 'hidden';?>;"/>
							<img id="qsvaddtoqlimg_js_rem<?php echo $qsresvideo->id; ?>" src="<?php echo JURI::root()."components/com_seyret/themes/default/images/added_ql.png";?>" alt="" style="visibility:<?php echo $inql==false ? 'hidden' : 'visible';?>; margin-left:-16px;"/>

						</div>						
					</div>

					<div class="listedvideolistextrasdivoc">
	
							
							<?php echo $qsresvideo->useravatar; ?><br/>
							<?php echo $qsresvideo->usernamelinked; ?>
							<div style="">
								<?php echo $qsresvideo->votestars; ?>
								<div class="clear"></div>
							</div>
							
							<?php echo JText::_('Views');?> : <?php echo $qsresvideo->hits; ?>
													
							
						
					</div>					

					
					<div class="clear"></div>
				</div>



				<?php	
	 
				
				}
						
			} else {

				foreach ($this->qsresvideos as $qsresvideo) {
				
					$safevideotitle = str_replace("'", "\'", $qsresvideo->videotitle);
					$safevideotitle = str_replace("\"", "&quot;", $safevideotitle);				
				
					$inql = false;
					if (in_array($qsresvideo->id, $this->quicklistarray)) {
						$inql = true;			
					}

				?>
				
				<div class="listedvideolistvideomc">
					<div class="backgroundpadding">
						<div class="listedvideolisttitledivmc">
							<a href="<?php echo $qsresvideo->videolink;?>" style="font-weight:bold;">
								<?php echo $qsresvideo->videotitle;?>
							</a>
						</div>
					</div>
					
					<div class="backgroundpadding">
						<div class="listedvideolistbodymc">
							<div class="listedvideolistthumbdivmc">
								<a href="<?php echo $qsresvideo->videolink;?>">
									<img class="listedvideolistthumbnailmc" src="<?php echo $qsresvideo->videothumbnail;?>" alt=""/> 
								</a>
								<div id="qsvaddtoqlbdiv<?php echo $qsresvideo->id; ?>" class="videolistqlbtnmc" >

									<img id="qsvaddtoqlimg_js_<?php echo $qsresvideo->id; ?>" class="addtoquicklistbutton" src="<?php echo JURI::root()."components/com_seyret/themes/default/images/add_ql.png";?>" alt="" onclick="jQuery.seyrettools.addtoquicklist('<?php echo $qsresvideo->id; ?>', '<?php echo htmlentities($qsresvideo->videothumbnail);?>', '<?php echo $safevideotitle; ?>', '<?php echo $qsresvideo->videonojxlink; ?>')" style="visibility:<?php echo ($inql==false)? 'visible' : 'hidden';?>;"/>
									<img id="qsvaddtoqlimg_js_rem<?php echo $qsresvideo->id; ?>" src="<?php echo JURI::root()."components/com_seyret/themes/default/images/added_ql.png";?>" alt="" style="visibility:<?php echo $inql==false ? 'hidden' : 'visible';?>; margin-left:-16px;"/>

								</div>	

								<div class="listedvideolistdurationdivmc"><?php echo $qsresvideo->duration;?>
								</div>
								
							</div>
							<div style="clear:both;"></div>
							<div class="listedvideolistvotestarsmc">
								<?php echo $qsresvideo->votestars; ?>
								<div class="clear"></div>
							</div>
							
							<div class="listedvideousernamemc">
								<?php echo $qsresvideo->usernamelinked; ?>
							</div>
							
							<div class="listedvideoaddeddatemc">
								<?php echo $qsresvideo->addeddate; ?>
							</div>
							
							<div class="clear"></div>

							<div class="listedvideousernamemc">
								<?php echo JText::_('Views');?>: <?php echo $qsresvideo->hits; ?>
							</div>
							
							<div class="listedvideoaddeddatemc">
								<?php echo JText::_('Comments');?>: <?php echo $qsresvideo->commentcount; ?>
							</div>
							
							<div class="clear"></div>

							
						</div>
					</div>
				</div>
				


				<?php	
	 
				
				}			
			
			
			}
			
			
			?>
			
			<div class="clear"></div>
			<div class="paginatordiv">
			
				<?php echo $this->qsvpageNav; ?>
			
			</div>		
						
			<div style="clear:both;"></div>
				
		</div>
		<?php
		} 
		?>		
	

		<?php if (isset($this->qsresplaylists)) {
		?>
<div id="playlistsresults"  >
				<?php
	
				$oddeven=1;
				
				
				foreach ($this->qsresplaylists as $qsvideo) {

				?>
				
				
				
				<div class="qsvideolistvideo<?php echo $oddeven?>">
					<div class="qsvideolistthumbnaildiv">
						<a href="<?php echo $qsvideo->playlistlink;?>">
							<img class="qsvideolistthumbnail" src="<?php echo $qsvideo->playlistthumbnail;?>" alt=""/> 
						</a>
					</div>
					<div class="qsvideolisttitlediv">
						<a href="<?php echo $qsvideo->playlistlink;?>">
							<?php	echo $qsvideo->playlisttitle;?>
						</a>
					</div>
					
					<div class="clear"></div>
				</div>



				<?php	
				


					if ($oddeven==1) {
					
						//if you want a two columns result view, play this
						$oddeven=2;
						echo "<div style=\"clear:both;\"></div>";
					} else {
						$oddeven=2;
						echo "<div style=\"clear:both;\"></div>";
					}	 
				
				}
				?>
				
				
				<div style="text-align:center;">
				
				<?php echo $this->ppageNav;

				?>
				
				</div>		
							
				<div style="clear:both;"></div>
				
		</div>
		<?php
		} 
		?>		

		<div id="channelsresults"  >
			
		</div>

	</div>			
			
</div>



</div>